rtc22 2.2.1
Loading...
Searching...
No Matches
RTC 22 Click Driver

API for configuring and manipulating RTC 22 Click driver. More...

Topics

 RTC 22 Registers List
 List of registers of RTC 22 Click driver.
 RTC 22 Registers Settings
 Settings for registers of RTC 22 Click driver.
 RTC 22 MikroBUS Map
 MikroBUS pin mapping of RTC 22 Click driver.

Functions

void rtc22_cfg_setup (rtc22_cfg_t *cfg)
 RTC 22 configuration object setup function.
err_t rtc22_init (rtc22_t *ctx, rtc22_cfg_t *cfg)
 RTC 22 initialization function.
err_t rtc22_write_regs (rtc22_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 22 write regs function.
err_t rtc22_read_regs (rtc22_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 22 read regs function.
err_t rtc22_write_reg (rtc22_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 22 write reg function.
err_t rtc22_read_reg (rtc22_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 22 read reg function.
void rtc22_set_wdi_pin (rtc22_t *ctx, uint8_t state)
 RTC 22 set WDI pin function.
uint8_t rtc22_get_psw_pin (rtc22_t *ctx)
 RTC 22 get PSW pin function.
uint8_t rtc22_get_tirq_pin (rtc22_t *ctx)
 RTC 22 get TIRQ pin function.
uint8_t rtc22_get_int_pin (rtc22_t *ctx)
 RTC 22 get INT pin function.
err_t rtc22_check_communication (rtc22_t *ctx)
 RTC 22 check communication function.
err_t rtc22_set_time (rtc22_t *ctx, rtc22_time_t *time)
 RTC 22 set time function.
err_t rtc22_read_time (rtc22_t *ctx, rtc22_time_t *time)
 RTC 22 read time function.
err_t rtc22_set_date (rtc22_t *ctx, rtc22_date_t *date)
 RTC 22 set date function.
err_t rtc22_read_date (rtc22_t *ctx, rtc22_date_t *date)
 RTC 22 read date function.

Detailed Description

API for configuring and manipulating RTC 22 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ rtc22_cfg_setup()

void rtc22_cfg_setup ( rtc22_cfg_t * cfg)

RTC 22 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See rtc22_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ rtc22_check_communication()

err_t rtc22_check_communication ( rtc22_t * ctx)

RTC 22 check communication function.

This function checks the communication by reading and verifying the device ID.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_get_int_pin()

uint8_t rtc22_get_int_pin ( rtc22_t * ctx)

RTC 22 get INT pin function.

This function returns the interrupt (INT) pin logic state.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ rtc22_get_psw_pin()

uint8_t rtc22_get_psw_pin ( rtc22_t * ctx)

RTC 22 get PSW pin function.

This function returns the power switch (PSW) pin logic state.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ rtc22_get_tirq_pin()

uint8_t rtc22_get_tirq_pin ( rtc22_t * ctx)

RTC 22 get TIRQ pin function.

This function returns the timer interrupt (TIRQ) pin logic state.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ rtc22_init()

err_t rtc22_init ( rtc22_t * ctx,
rtc22_cfg_t * cfg )

RTC 22 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See rtc22_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_read_date()

err_t rtc22_read_date ( rtc22_t * ctx,
rtc22_date_t * date )

RTC 22 read date function.

This function reads the current date values - day of week, day, month and year.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[out]date: Date object structure. See rtc22_date_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_read_reg()

err_t rtc22_read_reg ( rtc22_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 22 read reg function.

This function reads a data byte from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_read_regs()

err_t rtc22_read_regs ( rtc22_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

RTC 22 read regs function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_read_time()

err_t rtc22_read_time ( rtc22_t * ctx,
rtc22_time_t * time )

RTC 22 read time function.

This function reads the current time values - second 100th, second, minute and hour.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[out]time: Time object structure. See rtc22_time_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_set_date()

err_t rtc22_set_date ( rtc22_t * ctx,
rtc22_date_t * date )

RTC 22 set date function.

This function sets the starting date values - day of week, day, month and year.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]date: Date object structure that carries day of week, day, month and year values in Decimal format. See rtc22_date_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_set_time()

err_t rtc22_set_time ( rtc22_t * ctx,
rtc22_time_t * time )

RTC 22 set time function.

This function sets the starting time values - second 100th, second, minute and hour.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]time: Time object structure that carries second 100th, second, minute and hour values in Decimal format. See rtc22_time_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_set_wdi_pin()

void rtc22_set_wdi_pin ( rtc22_t * ctx,
uint8_t state )

RTC 22 set WDI pin function.

This function sets the watchdog reset (WDI) pin logic state.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ rtc22_write_reg()

err_t rtc22_write_reg ( rtc22_t * ctx,
uint8_t reg,
uint8_t data_in )

RTC 22 write reg function.

This function writes a data byte to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc22_write_regs()

err_t rtc22_write_regs ( rtc22_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

RTC 22 write regs function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc22_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.